
public class Expression {
	ConditionalAndExpr cae;
	Expression2 exp2;
	boolean fromIf ;
	int lineNum;
	int charPos;
	
	public Expression( ConditionalAndExpr cae, Expression2 exp2, int line, int charP){
		this.cae = cae;
		this.exp2 = exp2;
		fromIf = false;
		this.lineNum = line;
		this.charPos = charP;
	}
	public String toString(){
		String ret = "";

		String s = "";
		if (cae != null) {
			s +=  cae.toString();
		}
		if (exp2 != null) {
			s +=  "OR"+exp2.toString();
		}
		
		return ret+s;
	}
	public void check(Type type) throws SemanticException {
		// TODO
		if (exp2 != null) {
			//System.out.println("in EXP 1");
			exp2.fromIf = this.fromIf;
			exp2.check(type);
		}
		if (cae != null) {
			//System.out.println("in EXP 2");
			cae.fromIf = this.fromIf;
			cae.check(type);
		}
	}
}
